#include<bits/stdc++.h>
#include "QuickSort.h"

template<typename Comparable>
void sort(std::vector<Comparable>& A);

int main(int argc, char * argv[] )
{
  clock_t start, end;
  int n;
  std::cin>>n;
  std::vector<double>A(n);
  double temp;
  for( int i = 0; i<n; i++)
    {
      std::cin >> temp;
      A.push_back(temp);
    }
  int i;
  for( i=0; i<n-1; i++ )
    std:: cout << A[i] <<",";
  std::cout << A[i] << std::endl;
  double time  = sort<double>(A);
  for(i= 0; i<n-1 ; i++ )
    std::cout << A[i] << std::endl;
  std::cout << time << std::endl;
  return 0;
}
